/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.regex.Pattern;

/**
 * <p>Project: javase - Reg7
 * <p>Powered by webrx On 2021-12-07 14:13:38
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reg7 {
    public static void main(String[] args) {
        //System.out.println("hello6java".matches(".*\\d+.*"));
        //var p = Pattern.compile(".*\\d+.*");
        //System.out.println(p.matcher("hello6java").matches());

        //正则表达式 \\s 空格
        String name = "李四";
        var p = Pattern.compile("[a-z\\s]{1,50}|[\\u4e00-\\u9fa5]{2,4}", 2);
        System.out.println(p.matcher(name).matches());
        System.out.println(name.matches("[a-zA-Z ]+|[\\u4e00-\\u9fa5]+"));

    }
}
